import request from '@/utils/request'

// 基础配置
// 获取公司列表
export function companyList(data) {
  return request({
    url: '/backend/employee/company-list',
    method: 'get',
    params: data
  })
}
// 部门列表
export function sectionList(data) {
  return request({
    url: '/backend/employee/department-list',
    method: 'get',
    params: data
  })
}
// 新建公司
export function addCompany(data) {
  return request({
    url: '/backend/employee/create-company',
    method: 'post',
    data
  })
}
// 新建部门
export function addSection(data) {
  return request({
    url: '/backend/employee/create-department',
    method: 'post',
    data
  })
}
// 获取省
export function getProv(data) {
  return request({
    url: '/backend/employee/get-province-list',
    method: 'get',
    params: data
  })
}
// 获取市区
export function getCounty(data) {
  return request({
    url: '/backend/employee/city-area-list',
    method: 'get',
    params: data
  })
}
// 获取负责人
export function getManage(data) {
  return request({
    url: '/backend/employee/get-charge-list',
    method: 'get',
    params: data
  })
}
// 删除公司或部门
export function deleteCompany(data) {
  return request({
    url: '/backend/employee/delete-company-department',
    method: 'get',
    params: data
  })
}
// 获取公司或部门详情
export function getDetail(data) {
  return request({
    url: '/backend/employee/company-department-detail',
    method: 'get',
    params: data
  })
}
// 编辑公司
export function updateCompany(data) {
  return request({
    url: '/backend/employee/update-company',
    method: 'post',
    data
  })
}
// 编辑部门
export function updateSection(data) {
  return request({
    url: '/backend/employee/update-department',
    method: 'post',
    data
  })
}

// 员工花名册
// 获取公司下拉
export function getCompanySelect(data) {
  return request({
    url: '/backend/employee/company-pull-list',
    method: 'get',
    params: data
  })
}
// 获取部门下拉
export function getSectionSelect(data) {
  return request({
    url: '/backend/employee/department-pull-list',
    method: 'get',
    params: data
  })
}
// 获取其他下拉
export function getOtherSelect(data) {
  return request({
    url: '/backend/employee/other-pull-list',
    method: 'get',
    params: data
  })
}
// 获取转正日期
export function getPositiveTime(data) {
  return request({
    url: '/backend/employee/get-positive-time',
    method: 'get',
    params: data
  })
}
// 获取合同到期时间
export function getContractTime(data) {
  return request({
    url: '/backend/employee/get-contract-endline',
    method: 'get',
    params: data
  })
}
// 添加员工
export function addPerson(data) {
  return request({
    url: '/backend/employee',
    method: 'post',
    data
  })
}
// 员工列表
export function getPersonList(data) {
  return request({
    url: '/backend/employee',
    method: 'get',
    params: data
  })
}
// 搜索员工列表
export function searchList(data) {
  return request({
    url: '/backend/employee/search-pull-list',
    method: 'get',
    params: data
  })
}
// 员工状态总数
export function personCount(data) {
  return request({
    url: 'backend/employee/get-employee-num',
    method: 'get',
    params: data
  })
}
// 查看员工详情
export function personDetail(data) {
	return request({
		url: '/backend/employee/get-employee-info',
		method: 'get',
		params: data
	})
}

// 身份证获取生日
export function getBirth(data) {
	return request({
		url: '/backend/employee/get-birth-sex',
		method: 'get',
		params: data
	})
}
// 员工编辑保存
export function savePersonal(data) {
	return request({
		url: '/backend/employee/update-employee-info',
		method: 'post',
		data
	})
}
// 设置离职
export function setLeave(data) {
	return request({
		url: '/backend/employee/set-employee-leave',
		method: 'get',
		params: data
	})
}
// 恢复账号
export function setRecover(data) {
	return request({
		url: '/backend/employee/set-employee-recover',
		method: 'get',
		params: data
	})
}
// 创建任务完善信息
export function saveTask(data) {
	return request({
		url: '/backend/employee/improve-employee',
		method: 'post',
		data
	})
}
